const util = require("../../../../utils/util")
const func = require('./func')
const api = require('./api')
const oss_domain = getApp().globalData.oss_domain
const license_list = getApp().globalData.license_list
const pilot_rank_list = getApp().globalData.pilot_rank_list
const uav_type_list = getApp().globalData.uav_type_list
const uav_level_list = getApp().globalData.uav_level_list


// pages/apply_join_class/apply_join_class.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    license_list,
    pilot_rank_list,
    uav_type_list,
    uav_level_list,
    icon_url:oss_domain + 'static/picture/app_icon/',
    tomorrow:util.daysLaterOrAfter(new Date, 1),
  },
  
  view_photo(){func.view_photo(this)},
  reupload(){getApp().get_vibration();api.reupload(this)},
  set_stu_status(){func.set_stu_status(this)},
  set_label(){func.set_label(this)},
  set_ins(){func.set_ins(this)},
  update_addr(){func.update_addr(this)},
  update_email(){func.update_email(this)},
  update_license(){func.update_license(this)},
  update_uav_type(){func.update_uav_type(this)},
  update_uav_level(){func.update_uav_level(this)},
  update_pilotRank(){func.update_pilotRank(this)},
  
  update_addr_area(){
    getApp().get_vibration()
    let url_data = {
      jg_stu_id:this.data.stu_info.jg_stu_id,
      photo:this.data.stu_info.photo,
      stu_name:this.data.stu_info.real_name,
      province:this.data.stu_info.province,
      city:this.data.stu_info.city,
      area:this.data.stu_info.area,
      jg_id:this.data.stu_info.jg_id
    }
    wx.navigateTo({
      url: '/pages/students/stu_register/update_stu_addr_area/update_stu_addr_area?url_data=' + encodeURIComponent(JSON.stringify(url_data)),
    })
    this.can_onShow = true
},



  review(e){func.review(this,e)},
  back(e){func.back(this,e)},
  
  
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // console.log('options',options)
    this.jg_stu_id = options.jg_stu_id
    this.page_index_1 = options.page_index
    api.page_init(this,this.jg_stu_id)
  },

  onHide(){
  },

  onShow(){
    if(this.can_onShow){
      api.page_init(this,this.jg_stu_id)
      this.can_onShow = false
    }
  },

})